package com.szrt.day20161020.point02.service.impl;

import com.szrt.day20161020.point02.service.TicketService;

public class TicketServiceImpl implements  TicketService{
	
	
	
	
	/**
	 * 根据年龄来决定票的价格
	 * @param age
	 * @return
	 */
	public int sellTicketByAge(int age){
		int ticketPrice =100;
		if(age>=18){
			ticketPrice = ticketPrice;
		}else if(age>=12){
			ticketPrice = ticketPrice/2;
		}else{
			ticketPrice = 0;
		}
		return ticketPrice;
		
	}

}
